Hotel%20booking%20prediction%20title.png

In [1]:
In [2]:
Out[2]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date
0 Resort Hotel 0 342 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 3 No Deposit NaN NaN 0 Transient 0.0 0 0 Check-Out 2015-07-01
1 Resort Hotel 0 737 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 4 No Deposit NaN NaN 0 Transient 0.0 0 0 Check-Out 2015-07-01
2 Resort Hotel 0 7 2015 July 27 1 0 1 1 0.0 0 BB GBR Direct Direct 0 0 0 A C 0 No Deposit NaN NaN 0 Transient 75.0 0 0 Check-Out 2015-07-02
3 Resort Hotel 0 13 2015 July 27 1 0 1 1 0.0 0 BB GBR Corporate Corporate 0 0 0 A A 0 No Deposit 304.0 NaN 0 Transient 75.0 0 0 Check-Out 2015-07-02
4 Resort Hotel 0 14 2015 July 27 1 0 2 2 0.0 0 BB GBR Online TA TA/TO 0 0 0 A A 0 No Deposit 240.0 NaN 0 Transient 98.0 0 1 Check-Out 2015-07-03
In [3]:
Out[3]:
is_canceled lead_time arrival_date_year arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies is_repeated_guest previous_cancellations previous_bookings_not_canceled booking_changes agent company days_in_waiting_list adr required_car_parking_spaces total_of_special_requests
count 119390.000000 119390.000000 119390.000000 119390.000000 119390.000000 119390.000000 119390.000000 119390.000000 119386.000000 119390.000000 119390.000000 119390.000000 119390.000000 119390.000000 103050.000000 6797.000000 119390.000000 119390.000000 119390.000000 119390.000000
mean 0.370416 104.011416 2016.156554 27.165173 15.798241 0.927599 2.500302 1.856403 0.103890 0.007949 0.031912 0.087118 0.137097 0.221124 86.693382 189.266735 2.321149 101.831122 0.062518 0.571363
std 0.482918 106.863097 0.707476 13.605138 8.780829 0.998613 1.908286 0.579261 0.398561 0.097436 0.175767 0.844336 1.497437 0.652306 110.774548 131.655015 17.594721 50.535790 0.245291 0.792798
min 0.000000 0.000000 2015.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 6.000000 0.000000 -6.380000 0.000000 0.000000
25% 0.000000 18.000000 2016.000000 16.000000 8.000000 0.000000 1.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 9.000000 62.000000 0.000000 69.290000 0.000000 0.000000
50% 0.000000 69.000000 2016.000000 28.000000 16.000000 1.000000 2.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 14.000000 179.000000 0.000000 94.575000 0.000000 0.000000
75% 1.000000 160.000000 2017.000000 38.000000 23.000000 2.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 229.000000 270.000000 0.000000 126.000000 0.000000 1.000000
max 1.000000 737.000000 2017.000000 53.000000 31.000000 19.000000 50.000000 55.000000 10.000000 10.000000 1.000000 26.000000 72.000000 21.000000 535.000000 543.000000 391.000000 5400.000000 8.000000 5.000000
In [4]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 119390 entries, 0 to 119389
Data columns (total 32 columns):
 #   Column                          Non-Null Count   Dtype  
---  ------                          --------------   -----  
 0   hotel                           119390 non-null  object 
 1   is_canceled                     119390 non-null  int64  
 2   lead_time                       119390 non-null  int64  
 3   arrival_date_year               119390 non-null  int64  
 4   arrival_date_month              119390 non-null  object 
 5   arrival_date_week_number        119390 non-null  int64  
 6   arrival_date_day_of_month       119390 non-null  int64  
 7   stays_in_weekend_nights         119390 non-null  int64  
 8   stays_in_week_nights            119390 non-null  int64  
 9   adults                          119390 non-null  int64  
 10  children                        119386 non-null  float64
 11  babies                          119390 non-null  int64  
 12  meal                            119390 non-null  object 
 13  country                         118902 non-null  object 
 14  market_segment                  119390 non-null  object 
 15  distribution_channel            119390 non-null  object 
 16  is_repeated_guest               119390 non-null  int64  
 17  previous_cancellations          119390 non-null  int64  
 18  previous_bookings_not_canceled  119390 non-null  int64  
 19  reserved_room_type              119390 non-null  object 
 20  assigned_room_type              119390 non-null  object 
 21  booking_changes                 119390 non-null  int64  
 22  deposit_type                    119390 non-null  object 
 23  agent                           103050 non-null  float64
 24  company                         6797 non-null    float64
 25  days_in_waiting_list            119390 non-null  int64  
 26  customer_type                   119390 non-null  object 
 27  adr                             119390 non-null  float64
 28  required_car_parking_spaces     119390 non-null  int64  
 29  total_of_special_requests       119390 non-null  int64  
 30  reservation_status              119390 non-null  object 
 31  reservation_status_date         119390 non-null  object 
dtypes: float64(4), int64(16), object(12)
memory usage: 29.1+ MB
In [5]:
Out[5]:
Null Values Percentage Null Values
hotel 0 0.000000
is_canceled 0 0.000000
lead_time 0 0.000000
arrival_date_year 0 0.000000
arrival_date_month 0 0.000000
arrival_date_week_number 0 0.000000
arrival_date_day_of_month 0 0.000000
stays_in_weekend_nights 0 0.000000
stays_in_week_nights 0 0.000000
adults 0 0.000000
children 4 0.003350
babies 0 0.000000
meal 0 0.000000
country 488 0.408744
market_segment 0 0.000000
distribution_channel 0 0.000000
is_repeated_guest 0 0.000000
previous_cancellations 0 0.000000
previous_bookings_not_canceled 0 0.000000
reserved_room_type 0 0.000000
assigned_room_type 0 0.000000
booking_changes 0 0.000000
deposit_type 0 0.000000
agent 16340 13.686238
company 112593 94.306893
days_in_waiting_list 0 0.000000
customer_type 0 0.000000
adr 0 0.000000
required_car_parking_spaces 0 0.000000
total_of_special_requests 0 0.000000
reservation_status 0 0.000000
reservation_status_date 0 0.000000
In [6]:
In [7]:
In [8]:
Out[8]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date
2224 Resort Hotel 0 1 2015 October 41 6 0 3 0 0.0 0 SC PRT Corporate Corporate 0 0 0 A I 1 No Deposit 0.0 174.0 0 Transient-Party 0.00 0 0 Check-Out 2015-10-06
2409 Resort Hotel 0 0 2015 October 42 12 0 0 0 0.0 0 SC PRT Corporate Corporate 0 0 0 A I 0 No Deposit 0.0 174.0 0 Transient 0.00 0 0 Check-Out 2015-10-12
3181 Resort Hotel 0 36 2015 November 47 20 1 2 0 0.0 0 SC ESP Groups TA/TO 0 0 0 A C 0 No Deposit 38.0 0.0 0 Transient-Party 0.00 0 0 Check-Out 2015-11-23
3684 Resort Hotel 0 165 2015 December 53 30 1 4 0 0.0 0 SC PRT Groups TA/TO 0 0 0 A A 1 No Deposit 308.0 0.0 122 Transient-Party 0.00 0 0 Check-Out 2016-01-04
3708 Resort Hotel 0 165 2015 December 53 30 2 4 0 0.0 0 SC PRT Groups TA/TO 0 0 0 A C 1 No Deposit 308.0 0.0 122 Transient-Party 0.00 0 0 Check-Out 2016-01-05
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
115029 City Hotel 0 107 2017 June 26 27 0 3 0 0.0 0 BB CHE Online TA TA/TO 0 0 0 A A 1 No Deposit 7.0 0.0 0 Transient 100.80 0 0 Check-Out 2017-06-30
115091 City Hotel 0 1 2017 June 26 30 0 1 0 0.0 0 SC PRT Complementary Direct 0 0 0 E K 0 No Deposit 0.0 0.0 0 Transient 0.00 1 1 Check-Out 2017-07-01
116251 City Hotel 0 44 2017 July 28 15 1 1 0 0.0 0 SC SWE Online TA TA/TO 0 0 0 A K 2 No Deposit 425.0 0.0 0 Transient 73.80 0 0 Check-Out 2017-07-17
116534 City Hotel 0 2 2017 July 28 15 2 5 0 0.0 0 SC RUS Online TA TA/TO 0 0 0 A K 1 No Deposit 9.0 0.0 0 Transient-Party 22.86 0 1 Check-Out 2017-07-22
117087 City Hotel 0 170 2017 July 30 27 0 2 0 0.0 0 BB BRA Offline TA/TO TA/TO 0 0 0 A A 0 No Deposit 52.0 0.0 0 Transient 0.00 0 0 Check-Out 2017-07-29

180 rows × 32 columns

In [9]:
Out[9]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date
0 Resort Hotel 0 342 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 3 No Deposit 0.0 0.0 0 Transient 0.00 0 0 Check-Out 2015-07-01
1 Resort Hotel 0 737 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 4 No Deposit 0.0 0.0 0 Transient 0.00 0 0 Check-Out 2015-07-01
2 Resort Hotel 0 7 2015 July 27 1 0 1 1 0.0 0 BB GBR Direct Direct 0 0 0 A C 0 No Deposit 0.0 0.0 0 Transient 75.00 0 0 Check-Out 2015-07-02
3 Resort Hotel 0 13 2015 July 27 1 0 1 1 0.0 0 BB GBR Corporate Corporate 0 0 0 A A 0 No Deposit 304.0 0.0 0 Transient 75.00 0 0 Check-Out 2015-07-02
4 Resort Hotel 0 14 2015 July 27 1 0 2 2 0.0 0 BB GBR Online TA TA/TO 0 0 0 A A 0 No Deposit 240.0 0.0 0 Transient 98.00 0 1 Check-Out 2015-07-03
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
119385 City Hotel 0 23 2017 August 35 30 2 5 2 0.0 0 BB BEL Offline TA/TO TA/TO 0 0 0 A A 0 No Deposit 394.0 0.0 0 Transient 96.14 0 0 Check-Out 2017-09-06
119386 City Hotel 0 102 2017 August 35 31 2 5 3 0.0 0 BB FRA Online TA TA/TO 0 0 0 E E 0 No Deposit 9.0 0.0 0 Transient 225.43 0 2 Check-Out 2017-09-07
119387 City Hotel 0 34 2017 August 35 31 2 5 2 0.0 0 BB DEU Online TA TA/TO 0 0 0 D D 0 No Deposit 9.0 0.0 0 Transient 157.71 0 4 Check-Out 2017-09-07
119388 City Hotel 0 109 2017 August 35 31 2 5 2 0.0 0 BB GBR Online TA TA/TO 0 0 0 A A 0 No Deposit 89.0 0.0 0 Transient 104.40 0 0 Check-Out 2017-09-07
119389 City Hotel 0 205 2017 August 35 29 2 7 2 0.0 0 HB DEU Online TA TA/TO 0 0 0 A A 0 No Deposit 9.0 0.0 0 Transient 151.20 0 2 Check-Out 2017-09-07

119210 rows × 32 columns

Hotel%20booking%20prediction%202.png

In [10]:
Out[10]:
country No of guests
0 PRT 20977
1 GBR 9668
2 FRA 8468
3 ESP 6383
4 DEU 6067
... ... ...
161 BHR 1
162 DJI 1
163 MLI 1
164 NPL 1
165 FRO 1

166 rows × 2 columns

In [11]:

Hotel%20booking%20prediction%203.png

In [12]:
Out[12]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date
0 Resort Hotel 0 342 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 3 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01
1 Resort Hotel 0 737 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 4 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01
2 Resort Hotel 0 7 2015 July 27 1 0 1 1 0.0 0 BB GBR Direct Direct 0 0 0 A C 0 No Deposit 0.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02
3 Resort Hotel 0 13 2015 July 27 1 0 1 1 0.0 0 BB GBR Corporate Corporate 0 0 0 A A 0 No Deposit 304.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02
4 Resort Hotel 0 14 2015 July 27 1 0 2 2 0.0 0 BB GBR Online TA TA/TO 0 0 0 A A 0 No Deposit 240.0 0.0 0 Transient 98.0 0 1 Check-Out 2015-07-03

Hotel%20booking%20prediction%204.png

In [13]:
CADGEFHLB0100200300400500
hotelResort HotelCity Hotelreserved_room_typeadr

Hotel%20booking%20prediction%205.png

In [14]:
In [15]:
Out[15]:
arrival_date_month adr
0 April 75.867816
1 August 181.205892
2 December 68.410104
3 February 54.147478
4 January 48.761125
5 July 150.122528
6 June 107.974850
7 March 57.056838
8 May 76.657558
9 November 48.706289
10 October 61.775449
11 September 96.416860
In [16]:
Out[16]:
arrival_date_month adr
0 April 111.962267
1 August 118.674598
2 December 88.401855
3 February 86.520062
4 January 82.330983
5 July 115.818019
6 June 117.874360
7 March 90.658533
8 May 120.669827
9 November 86.946592
10 October 102.004672
11 September 112.776582
In [17]:
Out[17]:
month price_for_resort price_for_city_hotel
0 April 75.867816 111.962267
1 August 181.205892 118.674598
2 December 68.410104 88.401855
3 February 54.147478 86.520062
4 January 48.761125 82.330983
5 July 150.122528 115.818019
6 June 107.974850 117.874360
7 March 57.056838 90.658533
8 May 76.657558 120.669827
9 November 48.706289 86.946592
10 October 61.775449 102.004672
11 September 96.416860 112.776582

Hotel%20booking%20prediction%206.png

In [18]:
Requirement already satisfied: sort-dataframeby-monthorweek in c:\users\vanam ganesh\anaconda3\lib\site-packages (0.4)
Requirement already satisfied: sorted-months-weekdays in c:\users\vanam ganesh\anaconda3\lib\site-packages (0.2)
In [19]:
In [20]:
Out[20]:
month price_for_resort price_for_city_hotel
0 January 48.761125 82.330983
1 February 54.147478 86.520062
2 March 57.056838 90.658533
3 April 75.867816 111.962267
4 May 76.657558 120.669827
5 June 107.974850 117.874360
6 July 150.122528 115.818019
7 August 181.205892 118.674598
8 September 96.416860 112.776582
9 October 61.775449 102.004672
10 November 48.706289 86.946592
11 December 68.410104 88.401855
In [21]:
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember6080100120140160180
variableprice_for_resortprice_for_city_hotelRoom price per night over the Monthsmonthvalue
<Figure size 1700x800 with 0 Axes>

Hotel%20booking%20prediction%207.png

In [22]:
Out[22]:
month no of guests
0 August 3257
1 July 3137
2 October 2575
3 March 2571
4 April 2550
5 May 2535
6 February 2308
7 September 2102
8 June 2037
9 December 2014
10 November 1975
11 January 1866
In [23]:
Out[23]:
month no of guests
0 August 5367
1 July 4770
2 May 4568
3 June 4358
4 October 4326
5 September 4283
6 March 4049
7 April 4010
8 February 3051
9 November 2676
10 December 2377
11 January 2249
In [24]:
Out[24]:
month no of guests in resort no of guest in city hotel
0 August 3257 5367
1 July 3137 4770
2 October 2575 4326
3 March 2571 4049
4 April 2550 4010
5 May 2535 4568
6 February 2308 3051
7 September 2102 4283
8 June 2037 4358
9 December 2014 2377
10 November 1975 2676
11 January 1866 2249
In [25]:
Out[25]:
month no of guests in resort no of guest in city hotel
0 January 1866 2249
1 February 2308 3051
2 March 2571 4049
3 April 2550 4010
4 May 2535 4568
5 June 2037 4358
6 July 3137 4770
7 August 3257 5367
8 September 2102 4283
9 October 2575 4326
10 November 1975 2676
11 December 2014 2377
In [26]:
JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember20002500300035004000450050005500
variableno of guests in resortno of guest in city hotelTotal no of guests per Monthsmonthvalue

Hotel%20booking%20prediction%208.png

In [27]:
Out[27]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date
0 Resort Hotel 0 342 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 3 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01
1 Resort Hotel 0 737 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct 0 0 0 C C 4 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01
2 Resort Hotel 0 7 2015 July 27 1 0 1 1 0.0 0 BB GBR Direct Direct 0 0 0 A C 0 No Deposit 0.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02
3 Resort Hotel 0 13 2015 July 27 1 0 1 1 0.0 0 BB GBR Corporate Corporate 0 0 0 A A 0 No Deposit 304.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02
4 Resort Hotel 0 14 2015 July 27 1 0 2 2 0.0 0 BB GBR Online TA TA/TO 0 0 0 A A 0 No Deposit 240.0 0.0 0 Transient 98.0 0 1 Check-Out 2015-07-03
In [28]:
Out[28]:
hotel is_canceled lead_time arrival_date_year arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal country market_segment distribution_channel ... previous_cancellations previous_bookings_not_canceled reserved_room_type assigned_room_type booking_changes deposit_type agent company days_in_waiting_list customer_type adr required_car_parking_spaces total_of_special_requests reservation_status reservation_status_date total_nights
0 Resort Hotel 0 342 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct ... 0 0 C C 3 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01 0
1 Resort Hotel 0 737 2015 July 27 1 0 0 2 0.0 0 BB PRT Direct Direct ... 0 0 C C 4 No Deposit 0.0 0.0 0 Transient 0.0 0 0 Check-Out 2015-07-01 0
2 Resort Hotel 0 7 2015 July 27 1 0 1 1 0.0 0 BB GBR Direct Direct ... 0 0 A C 0 No Deposit 0.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02 1
3 Resort Hotel 0 13 2015 July 27 1 0 1 1 0.0 0 BB GBR Corporate Corporate ... 0 0 A A 0 No Deposit 304.0 0.0 0 Transient 75.0 0 0 Check-Out 2015-07-02 1
4 Resort Hotel 0 14 2015 July 27 1 0 2 2 0.0 0 BB GBR Online TA TA/TO ... 0 0 A A 0 No Deposit 240.0 0.0 0 Transient 98.0 0 1 Check-Out 2015-07-03 2

5 rows × 33 columns

In [29]:
Out[29]:
total_nights hotel Number of stays
0 0 City Hotel 251
1 0 Resort Hotel 371
2 1 City Hotel 9155
3 1 Resort Hotel 6579
4 2 City Hotel 10983
... ... ... ...
57 46 Resort Hotel 1
58 48 City Hotel 1
59 56 Resort Hotel 1
60 60 Resort Hotel 1
61 69 Resort Hotel 1

62 rows × 3 columns

In [30]:
010203040506002k4k6k8k10k12k
hotelCity HotelResort Hoteltotal_nightsNumber of stays

Hotel%20booking%20prediction%209.png

In [31]:
In [32]:
Out[32]:
is_canceled                       1.000000
lead_time                         0.292876
total_of_special_requests         0.234877
required_car_parking_spaces       0.195701
booking_changes                   0.144832
previous_cancellations            0.110139
is_repeated_guest                 0.083745
company                           0.083594
adults                            0.058182
previous_bookings_not_canceled    0.057365
days_in_waiting_list              0.054301
agent                             0.046770
adr                               0.046492
babies                            0.032569
stays_in_week_nights              0.025542
arrival_date_year                 0.016622
arrival_date_week_number          0.008315
arrival_date_day_of_month         0.005948
children                          0.004851
stays_in_weekend_nights           0.001323
Name: is_canceled, dtype: float64
In [33]:
In [34]:
Out[34]:
hotel is_canceled lead_time arrival_date_month arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies meal market_segment distribution_channel is_repeated_guest previous_cancellations previous_bookings_not_canceled reserved_room_type deposit_type agent company customer_type adr required_car_parking_spaces total_of_special_requests reservation_status_date
0 Resort Hotel 0 342 July 27 1 0 0 2 0.0 0 BB Direct Direct 0 0 0 C No Deposit 0.0 0.0 Transient 0.0 0 0 2015-07-01
1 Resort Hotel 0 737 July 27 1 0 0 2 0.0 0 BB Direct Direct 0 0 0 C No Deposit 0.0 0.0 Transient 0.0 0 0 2015-07-01
2 Resort Hotel 0 7 July 27 1 0 1 1 0.0 0 BB Direct Direct 0 0 0 A No Deposit 0.0 0.0 Transient 75.0 0 0 2015-07-02
3 Resort Hotel 0 13 July 27 1 0 1 1 0.0 0 BB Corporate Corporate 0 0 0 A No Deposit 304.0 0.0 Transient 75.0 0 0 2015-07-02
4 Resort Hotel 0 14 July 27 1 0 2 2 0.0 0 BB Online TA TA/TO 0 0 0 A No Deposit 240.0 0.0 Transient 98.0 0 1 2015-07-03
In [35]:
Out[35]:
['hotel',
 'arrival_date_month',
 'meal',
 'market_segment',
 'distribution_channel',
 'reserved_room_type',
 'deposit_type',
 'customer_type',
 'reservation_status_date']
In [36]:
Out[36]:
hotel arrival_date_month meal market_segment distribution_channel reserved_room_type deposit_type customer_type reservation_status_date
0 Resort Hotel July BB Direct Direct C No Deposit Transient 2015-07-01
1 Resort Hotel July BB Direct Direct C No Deposit Transient 2015-07-01
2 Resort Hotel July BB Direct Direct A No Deposit Transient 2015-07-02
3 Resort Hotel July BB Corporate Corporate A No Deposit Transient 2015-07-02
4 Resort Hotel July BB Online TA TA/TO A No Deposit Transient 2015-07-03
In [37]:
In [38]:
In [39]:
Out[39]:
hotel meal market_segment distribution_channel reserved_room_type deposit_type customer_type year month day
0 Resort Hotel BB Direct Direct C No Deposit Transient 2015 7 1
1 Resort Hotel BB Direct Direct C No Deposit Transient 2015 7 1
2 Resort Hotel BB Direct Direct A No Deposit Transient 2015 7 2
3 Resort Hotel BB Corporate Corporate A No Deposit Transient 2015 7 2
4 Resort Hotel BB Online TA TA/TO A No Deposit Transient 2015 7 3
In [40]:
hotel: 
['Resort Hotel' 'City Hotel']

meal: 
['BB' 'FB' 'HB' 'SC' 'Undefined']

market_segment: 
['Direct' 'Corporate' 'Online TA' 'Offline TA/TO' 'Complementary' 'Groups'
 'Undefined' 'Aviation']

distribution_channel: 
['Direct' 'Corporate' 'TA/TO' 'Undefined' 'GDS']

reserved_room_type: 
['C' 'A' 'D' 'E' 'G' 'F' 'H' 'L' 'B']

deposit_type: 
['No Deposit' 'Refundable' 'Non Refund']

customer_type: 
['Transient' 'Contract' 'Transient-Party' 'Group']

year: 
[2015 2014 2016 2017]

month: 
[ 7  5  4  6  3  8  9  1 11 10 12  2]

day: 
[ 1  2  3  6 22 23  5  7  8 11 15 16 29 19 18  9 13  4 12 26 17 10 20 14
 30 28 25 21 27 24 31]

In [41]:
In [42]:
Out[42]:
hotel meal market_segment distribution_channel reserved_room_type deposit_type customer_type year month day
0 0 0 0 0 0 0 0 0 7 1
1 0 0 0 0 0 0 0 0 7 1
2 0 0 0 0 1 0 0 0 7 2
3 0 0 1 1 1 0 0 0 7 2
4 0 0 2 2 1 0 0 0 7 3
In [43]:
Out[43]:
lead_time arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies is_repeated_guest previous_cancellations previous_bookings_not_canceled agent company adr required_car_parking_spaces total_of_special_requests
0 342 27 1 0 0 2 0.0 0 0 0 0 0.0 0.0 0.00 0 0
1 737 27 1 0 0 2 0.0 0 0 0 0 0.0 0.0 0.00 0 0
2 7 27 1 0 1 1 0.0 0 0 0 0 0.0 0.0 75.00 0 0
3 13 27 1 0 1 1 0.0 0 0 0 0 304.0 0.0 75.00 0 0
4 14 27 1 0 2 2 0.0 0 0 0 0 240.0 0.0 98.00 0 1
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
119385 23 35 30 2 5 2 0.0 0 0 0 0 394.0 0.0 96.14 0 0
119386 102 35 31 2 5 3 0.0 0 0 0 0 9.0 0.0 225.43 0 2
119387 34 35 31 2 5 2 0.0 0 0 0 0 9.0 0.0 157.71 0 4
119388 109 35 31 2 5 2 0.0 0 0 0 0 89.0 0.0 104.40 0 0
119389 205 35 29 2 7 2 0.0 0 0 0 0 9.0 0.0 151.20 0 2

119210 rows × 16 columns

In [44]:
Out[44]:
lead_time                         11422.361808
arrival_date_week_number            184.990111
arrival_date_day_of_month            77.107192
stays_in_weekend_nights               0.990258
stays_in_week_nights                  3.599010
adults                                0.330838
children                              0.159070
babies                                0.009508
is_repeated_guest                     0.030507
previous_cancellations                0.713887
previous_bookings_not_canceled        2.244415
agent                             11485.169679
company                            2897.684308
adr                                2543.589039
required_car_parking_spaces           0.060201
total_of_special_requests             0.628652
dtype: float64
In [45]:
In [46]:
Out[46]:
lead_time                         2.582757
arrival_date_week_number          0.440884
arrival_date_day_of_month         0.506325
stays_in_weekend_nights           0.990258
stays_in_week_nights              3.599010
adults                            0.330838
children                          0.159070
babies                            0.009508
is_repeated_guest                 0.030507
previous_cancellations            0.713887
previous_bookings_not_canceled    2.244415
agent                             3.535793
company                           1.346883
adr                               0.515480
required_car_parking_spaces       0.060201
total_of_special_requests         0.628652
dtype: float64
In [47]:
In [48]:
Out[48]:
lead_time arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies is_repeated_guest previous_cancellations previous_bookings_not_canceled agent company adr required_car_parking_spaces total_of_special_requests
0 5.837730 3.332205 0.693147 0 0 2 0.0 0 0 0 0 0.000000 0.0 0.000000 0 0
1 6.603944 3.332205 0.693147 0 0 2 0.0 0 0 0 0 0.000000 0.0 0.000000 0 0
2 2.079442 3.332205 0.693147 0 1 1 0.0 0 0 0 0 0.000000 0.0 4.330733 0 0
3 2.639057 3.332205 0.693147 0 1 1 0.0 0 0 0 0 5.720312 0.0 4.330733 0 0
4 2.708050 3.332205 0.693147 0 2 2 0.0 0 0 0 0 5.484797 0.0 4.595120 0 1
In [49]:
In [50]:
Out[50]:
((119210, 26), (119210,))
In [51]:
In [52]:
Out[52]:
hotel meal market_segment distribution_channel reserved_room_type deposit_type customer_type year month day lead_time arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies is_repeated_guest previous_cancellations previous_bookings_not_canceled agent company adr required_car_parking_spaces total_of_special_requests
38624 0 0 2 2 1 0 0 3 7 24 4.875197 3.401197 3.044522 1 3 2 0.0 0 0 0 0 5.484797 0.0 5.141664 0 1
89121 1 2 3 2 1 0 0 2 5 17 0.000000 3.091042 2.890372 0 0 1 0.0 0 1 0 0 1.945910 0.0 0.000000 0 0
104550 1 0 2 2 1 0 0 3 1 17 3.970292 1.098612 2.708050 2 1 2 0.0 0 0 0 0 2.302585 0.0 4.485823 0 0
44014 1 0 3 2 1 0 2 0 10 1 4.234107 3.713572 3.401197 0 2 2 0.0 0 0 0 0 3.044522 0.0 4.189655 0 0
108495 1 0 5 2 1 0 2 3 3 29 5.332719 2.639057 3.295837 2 1 2 0.0 0 0 0 0 5.693732 0.0 4.290459 0 0
In [53]:
Out[53]:
hotel meal market_segment distribution_channel reserved_room_type deposit_type customer_type year month day lead_time arrival_date_week_number arrival_date_day_of_month stays_in_weekend_nights stays_in_week_nights adults children babies is_repeated_guest previous_cancellations previous_bookings_not_canceled agent company adr required_car_parking_spaces total_of_special_requests
35672 0 4 5 2 1 0 2 3 4 29 3.178054 2.833213 3.135494 2 5 2 0.0 0 0 0 0 6.269096 0.0 4.653960 0 0
49015 1 0 2 2 8 0 2 2 4 8 4.521789 2.772589 1.609438 1 3 0 2.0 0 0 0 0 2.302585 0.0 4.314015 0 0
96800 1 3 2 2 1 0 0 2 9 8 3.951244 3.637586 2.079442 0 1 2 0.0 0 0 0 0 2.302585 0.0 4.480740 0 1
43200 1 0 2 2 1 0 2 0 9 18 3.637586 3.663562 2.833213 0 2 1 0.0 0 0 0 0 2.302585 0.0 4.460144 1 0
87464 1 0 2 2 2 0 0 2 4 20 4.430817 2.833213 2.833213 2 2 2 0.0 0 0 0 0 2.302585 0.0 4.651099 0 0
In [54]:
Out[54]:
(38624     0
 89121     0
 104550    0
 44014     0
 108495    0
 Name: is_canceled, dtype: int64,
 35672    0
 49015    0
 96800    0
 43200    0
 87464    0
 Name: is_canceled, dtype: int64)

Hotel%20booking%20prediction%2010.png

In [55]:
Accuracy Score of Logistic Regression is : 0.8108100550848643
Confusion Matrix : 
[[21396  1153]
 [ 5613  7601]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.79      0.95      0.86     22549
           1       0.87      0.58      0.69     13214

    accuracy                           0.81     35763
   macro avg       0.83      0.76      0.78     35763
weighted avg       0.82      0.81      0.80     35763

Hotel%20booking%20prediction%2011.png

In [56]:
Accuracy Score of KNN is : 0.8928501523921372
Confusion Matrix : 
[[21794   755]
 [ 3077 10137]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.88      0.97      0.92     22549
           1       0.93      0.77      0.84     13214

    accuracy                           0.89     35763
   macro avg       0.90      0.87      0.88     35763
weighted avg       0.90      0.89      0.89     35763

Hotel%20booking%20prediction%2012.png

In [57]:
Accuracy Score of Decision Tree is : 0.9459776864357017
Confusion Matrix : 
[[21614   935]
 [  997 12217]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.96      0.96      0.96     22549
           1       0.93      0.92      0.93     13214

    accuracy                           0.95     35763
   macro avg       0.94      0.94      0.94     35763
weighted avg       0.95      0.95      0.95     35763

Hotel%20booking%20prediction%2013.png

In [58]:
Accuracy Score of Random Forest is : 0.9531359226015714
Confusion Matrix : 
[[22359   190]
 [ 1486 11728]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.94      0.99      0.96     22549
           1       0.98      0.89      0.93     13214

    accuracy                           0.95     35763
   macro avg       0.96      0.94      0.95     35763
weighted avg       0.95      0.95      0.95     35763

Hotel%20booking%20prediction%2014.png

In [59]:
Accuracy Score of Ada Boost Classifier is : 0.9461734194558622
Confusion Matrix : 
[[21610   939]
 [  986 12228]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.96      0.96      0.96     22549
           1       0.93      0.93      0.93     13214

    accuracy                           0.95     35763
   macro avg       0.94      0.94      0.94     35763
weighted avg       0.95      0.95      0.95     35763

Hotel%20booking%20prediction%2015.png

In [60]:
Accuracy Score of Ada Boost Classifier is : 0.9068870061236474
Confusion Matrix : 
[[22357   192]
 [ 3138 10076]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.88      0.99      0.93     22549
           1       0.98      0.76      0.86     13214

    accuracy                           0.91     35763
   macro avg       0.93      0.88      0.89     35763
weighted avg       0.92      0.91      0.90     35763

Hotel%20booking%20prediction%2016.png

In [61]:
Accuracy Score of Ada Boost Classifier is : 0.982775494225876
Confusion Matrix : 
[[22540     9]
 [  607 12607]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.97      1.00      0.99     22549
           1       1.00      0.95      0.98     13214

    accuracy                           0.98     35763
   macro avg       0.99      0.98      0.98     35763
weighted avg       0.98      0.98      0.98     35763

Hotel%20booking%20prediction%2017.png

In [62]:
Learning rate set to 0.5
0:	learn: 0.4774489	total: 168ms	remaining: 16.6s
1:	learn: 0.4099448	total: 190ms	remaining: 9.3s
2:	learn: 0.3881026	total: 236ms	remaining: 7.62s
3:	learn: 0.3744939	total: 254ms	remaining: 6.09s
4:	learn: 0.3351923	total: 272ms	remaining: 5.17s
5:	learn: 0.3116078	total: 291ms	remaining: 4.56s
6:	learn: 0.2621791	total: 311ms	remaining: 4.13s
7:	learn: 0.2294745	total: 329ms	remaining: 3.79s
8:	learn: 0.2012482	total: 351ms	remaining: 3.55s
9:	learn: 0.1862155	total: 368ms	remaining: 3.31s
10:	learn: 0.1800745	total: 386ms	remaining: 3.12s
11:	learn: 0.1650377	total: 411ms	remaining: 3.01s
12:	learn: 0.1627060	total: 430ms	remaining: 2.88s
13:	learn: 0.1546355	total: 450ms	remaining: 2.77s
14:	learn: 0.1483972	total: 469ms	remaining: 2.66s
15:	learn: 0.1337675	total: 488ms	remaining: 2.56s
16:	learn: 0.1238811	total: 508ms	remaining: 2.48s
17:	learn: 0.1180062	total: 528ms	remaining: 2.4s
18:	learn: 0.1113086	total: 546ms	remaining: 2.33s
19:	learn: 0.1096049	total: 562ms	remaining: 2.25s
20:	learn: 0.1031047	total: 580ms	remaining: 2.18s
21:	learn: 0.0974372	total: 598ms	remaining: 2.12s
22:	learn: 0.0964772	total: 615ms	remaining: 2.06s
23:	learn: 0.0952203	total: 642ms	remaining: 2.03s
24:	learn: 0.0903946	total: 660ms	remaining: 1.98s
25:	learn: 0.0875688	total: 678ms	remaining: 1.93s
26:	learn: 0.0837066	total: 698ms	remaining: 1.89s
27:	learn: 0.0824527	total: 716ms	remaining: 1.84s
28:	learn: 0.0791983	total: 733ms	remaining: 1.79s
29:	learn: 0.0756174	total: 751ms	remaining: 1.75s
30:	learn: 0.0734568	total: 768ms	remaining: 1.71s
31:	learn: 0.0709683	total: 787ms	remaining: 1.67s
32:	learn: 0.0693680	total: 804ms	remaining: 1.63s
33:	learn: 0.0687766	total: 821ms	remaining: 1.59s
34:	learn: 0.0667692	total: 840ms	remaining: 1.56s
35:	learn: 0.0656304	total: 859ms	remaining: 1.53s
36:	learn: 0.0639526	total: 883ms	remaining: 1.5s
37:	learn: 0.0620881	total: 909ms	remaining: 1.48s
38:	learn: 0.0599174	total: 927ms	remaining: 1.45s
39:	learn: 0.0583084	total: 943ms	remaining: 1.41s
40:	learn: 0.0565332	total: 960ms	remaining: 1.38s
41:	learn: 0.0547727	total: 978ms	remaining: 1.35s
42:	learn: 0.0534991	total: 994ms	remaining: 1.32s
43:	learn: 0.0519240	total: 1.01s	remaining: 1.29s
44:	learn: 0.0500912	total: 1.03s	remaining: 1.25s
45:	learn: 0.0482632	total: 1.05s	remaining: 1.23s
46:	learn: 0.0469748	total: 1.07s	remaining: 1.21s
47:	learn: 0.0457929	total: 1.09s	remaining: 1.18s
48:	learn: 0.0450244	total: 1.11s	remaining: 1.15s
49:	learn: 0.0434806	total: 1.13s	remaining: 1.13s
50:	learn: 0.0427655	total: 1.15s	remaining: 1.11s
51:	learn: 0.0425397	total: 1.17s	remaining: 1.08s
52:	learn: 0.0420377	total: 1.2s	remaining: 1.06s
53:	learn: 0.0406588	total: 1.23s	remaining: 1.05s
54:	learn: 0.0396324	total: 1.26s	remaining: 1.03s
55:	learn: 0.0382739	total: 1.28s	remaining: 1s
56:	learn: 0.0372388	total: 1.3s	remaining: 985ms
57:	learn: 0.0367655	total: 1.33s	remaining: 963ms
58:	learn: 0.0353569	total: 1.36s	remaining: 942ms
59:	learn: 0.0347135	total: 1.38s	remaining: 921ms
60:	learn: 0.0342275	total: 1.41s	remaining: 900ms
61:	learn: 0.0323055	total: 1.44s	remaining: 882ms
62:	learn: 0.0320436	total: 1.47s	remaining: 862ms
63:	learn: 0.0311542	total: 1.5s	remaining: 842ms
64:	learn: 0.0302633	total: 1.52s	remaining: 820ms
65:	learn: 0.0297369	total: 1.55s	remaining: 799ms
66:	learn: 0.0289855	total: 1.57s	remaining: 776ms
67:	learn: 0.0283924	total: 1.6s	remaining: 753ms
68:	learn: 0.0273383	total: 1.63s	remaining: 731ms
69:	learn: 0.0269380	total: 1.65s	remaining: 708ms
70:	learn: 0.0263231	total: 1.68s	remaining: 685ms
71:	learn: 0.0262159	total: 1.71s	remaining: 663ms
72:	learn: 0.0260288	total: 1.73s	remaining: 640ms
73:	learn: 0.0252093	total: 1.76s	remaining: 617ms
74:	learn: 0.0243925	total: 1.78s	remaining: 594ms
75:	learn: 0.0239835	total: 1.81s	remaining: 572ms
76:	learn: 0.0237039	total: 1.83s	remaining: 548ms
77:	learn: 0.0236310	total: 1.86s	remaining: 524ms
78:	learn: 0.0233065	total: 1.89s	remaining: 502ms
79:	learn: 0.0226419	total: 1.92s	remaining: 480ms
80:	learn: 0.0215113	total: 1.95s	remaining: 457ms
81:	learn: 0.0211554	total: 1.97s	remaining: 433ms
82:	learn: 0.0208771	total: 2s	remaining: 410ms
83:	learn: 0.0201017	total: 2.04s	remaining: 388ms
84:	learn: 0.0198782	total: 2.06s	remaining: 364ms
85:	learn: 0.0196287	total: 2.09s	remaining: 340ms
86:	learn: 0.0185357	total: 2.12s	remaining: 317ms
87:	learn: 0.0178998	total: 2.14s	remaining: 292ms
88:	learn: 0.0177477	total: 2.17s	remaining: 268ms
89:	learn: 0.0174317	total: 2.19s	remaining: 244ms
90:	learn: 0.0173697	total: 2.22s	remaining: 219ms
91:	learn: 0.0169856	total: 2.24s	remaining: 195ms
92:	learn: 0.0168566	total: 2.27s	remaining: 171ms
93:	learn: 0.0166305	total: 2.29s	remaining: 146ms
94:	learn: 0.0163336	total: 2.32s	remaining: 122ms
95:	learn: 0.0157902	total: 2.35s	remaining: 98ms
96:	learn: 0.0156579	total: 2.38s	remaining: 73.5ms
97:	learn: 0.0150934	total: 2.4s	remaining: 49.1ms
98:	learn: 0.0149152	total: 2.43s	remaining: 24.5ms
99:	learn: 0.0144791	total: 2.46s	remaining: 0us

Hotel%20booking%20prediction%2018.png

In [63]:
Accuracy Score of Ada Boost Classifier is : 0.9508710119397142
Confusion Matrix : 
[[22319   230]
 [ 1527 11687]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.94      0.99      0.96     22549
           1       0.98      0.88      0.93     13214

    accuracy                           0.95     35763
   macro avg       0.96      0.94      0.95     35763
weighted avg       0.95      0.95      0.95     35763

Hotel%20booking%20prediction%2019.png

In [64]:
[LightGBM] [Info] Number of positive: 30985, number of negative: 52462
[LightGBM] [Warning] Auto-choosing row-wise multi-threading, the overhead of testing was 0.006839 seconds.
You can set `force_row_wise=true` to remove the overhead.
And if memory is not enough, you can set `force_col_wise=true`.
[LightGBM] [Info] Total Bins 1205
[LightGBM] [Info] Number of data points in the train set: 83447, number of used features: 26
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.371314 -> initscore=-0.526586
[LightGBM] [Info] Start training from score -0.526586
Accuracy Score of Ada Boost Classifier is : 0.9672007381931046
Confusion Matrix : 
[[21990   559]
 [  614 12600]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.97      0.98      0.97     22549
           1       0.96      0.95      0.96     13214

    accuracy                           0.97     35763
   macro avg       0.97      0.96      0.96     35763
weighted avg       0.97      0.97      0.97     35763

Hotel%20booking%20prediction%2020.png

In [65]:
Learning rate set to 0.5
0:	learn: 0.4774489	total: 17.9ms	remaining: 1.77s
1:	learn: 0.4099448	total: 34.7ms	remaining: 1.7s
2:	learn: 0.3881026	total: 51.1ms	remaining: 1.65s
3:	learn: 0.3744939	total: 67.5ms	remaining: 1.62s
4:	learn: 0.3351923	total: 84.7ms	remaining: 1.61s
5:	learn: 0.3116078	total: 101ms	remaining: 1.58s
6:	learn: 0.2621791	total: 118ms	remaining: 1.56s
7:	learn: 0.2294745	total: 137ms	remaining: 1.57s
8:	learn: 0.2012482	total: 159ms	remaining: 1.61s
9:	learn: 0.1862155	total: 177ms	remaining: 1.59s
10:	learn: 0.1800745	total: 196ms	remaining: 1.59s
11:	learn: 0.1650377	total: 216ms	remaining: 1.58s
12:	learn: 0.1627060	total: 234ms	remaining: 1.56s
13:	learn: 0.1546355	total: 250ms	remaining: 1.54s
14:	learn: 0.1483972	total: 268ms	remaining: 1.52s
15:	learn: 0.1337675	total: 285ms	remaining: 1.5s
16:	learn: 0.1238811	total: 303ms	remaining: 1.48s
17:	learn: 0.1180062	total: 320ms	remaining: 1.46s
18:	learn: 0.1113086	total: 337ms	remaining: 1.44s
19:	learn: 0.1096049	total: 352ms	remaining: 1.41s
20:	learn: 0.1031047	total: 371ms	remaining: 1.39s
21:	learn: 0.0974372	total: 389ms	remaining: 1.38s
22:	learn: 0.0964772	total: 407ms	remaining: 1.36s
23:	learn: 0.0952203	total: 425ms	remaining: 1.34s
24:	learn: 0.0903946	total: 443ms	remaining: 1.33s
25:	learn: 0.0875688	total: 461ms	remaining: 1.31s
26:	learn: 0.0837066	total: 480ms	remaining: 1.3s
27:	learn: 0.0824527	total: 498ms	remaining: 1.28s
28:	learn: 0.0791983	total: 515ms	remaining: 1.26s
29:	learn: 0.0756174	total: 536ms	remaining: 1.25s
30:	learn: 0.0734568	total: 557ms	remaining: 1.24s
31:	learn: 0.0709683	total: 577ms	remaining: 1.23s
32:	learn: 0.0693680	total: 597ms	remaining: 1.21s
33:	learn: 0.0687766	total: 618ms	remaining: 1.2s
34:	learn: 0.0667692	total: 640ms	remaining: 1.19s
35:	learn: 0.0656304	total: 659ms	remaining: 1.17s
36:	learn: 0.0639526	total: 680ms	remaining: 1.16s
37:	learn: 0.0620881	total: 697ms	remaining: 1.14s
38:	learn: 0.0599174	total: 715ms	remaining: 1.12s
39:	learn: 0.0583084	total: 733ms	remaining: 1.1s
40:	learn: 0.0565332	total: 753ms	remaining: 1.08s
41:	learn: 0.0547727	total: 772ms	remaining: 1.06s
42:	learn: 0.0534991	total: 789ms	remaining: 1.04s
43:	learn: 0.0519240	total: 807ms	remaining: 1.03s
44:	learn: 0.0500912	total: 827ms	remaining: 1.01s
45:	learn: 0.0482632	total: 844ms	remaining: 991ms
46:	learn: 0.0469748	total: 862ms	remaining: 972ms
47:	learn: 0.0457929	total: 878ms	remaining: 952ms
48:	learn: 0.0450244	total: 895ms	remaining: 931ms
49:	learn: 0.0434806	total: 914ms	remaining: 914ms
50:	learn: 0.0427655	total: 932ms	remaining: 896ms
51:	learn: 0.0425397	total: 950ms	remaining: 877ms
52:	learn: 0.0420377	total: 967ms	remaining: 858ms
53:	learn: 0.0406588	total: 985ms	remaining: 839ms
54:	learn: 0.0396324	total: 1s	remaining: 821ms
55:	learn: 0.0382739	total: 1.02s	remaining: 802ms
56:	learn: 0.0372388	total: 1.04s	remaining: 785ms
57:	learn: 0.0367655	total: 1.06s	remaining: 767ms
58:	learn: 0.0353569	total: 1.08s	remaining: 750ms
59:	learn: 0.0347135	total: 1.1s	remaining: 732ms
60:	learn: 0.0342275	total: 1.12s	remaining: 715ms
61:	learn: 0.0323055	total: 1.14s	remaining: 700ms
62:	learn: 0.0320436	total: 1.16s	remaining: 681ms
63:	learn: 0.0311542	total: 1.18s	remaining: 662ms
64:	learn: 0.0302633	total: 1.19s	remaining: 643ms
65:	learn: 0.0297369	total: 1.22s	remaining: 626ms
66:	learn: 0.0289855	total: 1.23s	remaining: 607ms
67:	learn: 0.0283924	total: 1.25s	remaining: 589ms
68:	learn: 0.0273383	total: 1.27s	remaining: 571ms
69:	learn: 0.0269380	total: 1.29s	remaining: 552ms
70:	learn: 0.0263231	total: 1.3s	remaining: 533ms
71:	learn: 0.0262159	total: 1.32s	remaining: 514ms
72:	learn: 0.0260288	total: 1.34s	remaining: 495ms
73:	learn: 0.0252093	total: 1.36s	remaining: 477ms
74:	learn: 0.0243925	total: 1.38s	remaining: 460ms
75:	learn: 0.0239835	total: 1.4s	remaining: 441ms
76:	learn: 0.0237039	total: 1.41s	remaining: 422ms
77:	learn: 0.0236310	total: 1.43s	remaining: 403ms
78:	learn: 0.0233065	total: 1.44s	remaining: 384ms
79:	learn: 0.0226419	total: 1.46s	remaining: 366ms
80:	learn: 0.0215113	total: 1.48s	remaining: 348ms
81:	learn: 0.0211554	total: 1.5s	remaining: 330ms
82:	learn: 0.0208771	total: 1.52s	remaining: 313ms
83:	learn: 0.0201017	total: 1.54s	remaining: 294ms
84:	learn: 0.0198782	total: 1.56s	remaining: 276ms
85:	learn: 0.0196287	total: 1.58s	remaining: 257ms
86:	learn: 0.0185357	total: 1.6s	remaining: 239ms
87:	learn: 0.0178998	total: 1.62s	remaining: 220ms
88:	learn: 0.0177477	total: 1.63s	remaining: 202ms
89:	learn: 0.0174317	total: 1.65s	remaining: 183ms
90:	learn: 0.0173697	total: 1.67s	remaining: 165ms
91:	learn: 0.0169856	total: 1.69s	remaining: 147ms
92:	learn: 0.0168566	total: 1.7s	remaining: 128ms
93:	learn: 0.0166305	total: 1.72s	remaining: 110ms
94:	learn: 0.0163336	total: 1.74s	remaining: 91.5ms
95:	learn: 0.0157902	total: 1.76s	remaining: 73.2ms
96:	learn: 0.0156579	total: 1.77s	remaining: 54.9ms
97:	learn: 0.0150934	total: 1.79s	remaining: 36.6ms
98:	learn: 0.0149152	total: 1.81s	remaining: 18.3ms
99:	learn: 0.0144791	total: 1.83s	remaining: 0us
[LightGBM] [Info] Number of positive: 30985, number of negative: 52462
[LightGBM] [Warning] Auto-choosing row-wise multi-threading, the overhead of testing was 0.006679 seconds.
You can set `force_row_wise=true` to remove the overhead.
And if memory is not enough, you can set `force_col_wise=true`.
[LightGBM] [Info] Total Bins 1205
[LightGBM] [Info] Number of data points in the train set: 83447, number of used features: 26
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.371314 -> initscore=-0.526586
[LightGBM] [Info] Start training from score -0.526586
Out[65]:
VotingClassifier(estimators=[('Gradient Boosting Classifier',
                              GradientBoostingClassifier()),
                             ('Cat Boost Classifier',
                              <catboost.core.CatBoostClassifier object at 0x000002800C4248D0>),
                             ('XGboost',
                              XGBClassifier(base_score=None, booster='gbtree',
                                            callbacks=None,
                                            colsample_bylevel=None,
                                            colsample_bynode=None,
                                            colsample_bytree=None,
                                            early_stopping_rounds=None,
                                            enable_cat...
                                            num_parallel_tree=None,
                                            predictor=None, random_state=None, ...)),
                             ('Decision Tree', DecisionTreeClassifier()),
                             ('Extra Tree', ExtraTreesClassifier()),
                             ('Light Gradient',
                              LGBMClassifier(learning_rate=1)),
                             ('Random Forest', RandomForestClassifier()),
                             ('Ada Boost',
                              AdaBoostClassifier(base_estimator=DecisionTreeClassifier())),
                             ('Logistic', LogisticRegression()),
                             ('Knn', KNeighborsClassifier())])
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
In [66]:
Accuracy Score of Ada Boost Classifier is : 0.9631183066297571
Confusion Matrix : 
[[22526    23]
 [ 1296 11918]]
Classification Report : 
              precision    recall  f1-score   support

           0       0.95      1.00      0.97     22549
           1       1.00      0.90      0.95     13214

    accuracy                           0.96     35763
   macro avg       0.97      0.95      0.96     35763
weighted avg       0.96      0.96      0.96     35763

Hotel%20booking%20prediction%2021.png

In [67]:
In [68]:
In [69]:
Epoch 1/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.3352 - accuracy: 0.8611 - val_loss: 0.2106 - val_accuracy: 0.9248
Epoch 2/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.1657 - accuracy: 0.9431 - val_loss: 0.1342 - val_accuracy: 0.9566
Epoch 3/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.1226 - accuracy: 0.9608 - val_loss: 0.0997 - val_accuracy: 0.9684
Epoch 4/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.1007 - accuracy: 0.9676 - val_loss: 0.0804 - val_accuracy: 0.9745
Epoch 5/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0870 - accuracy: 0.9727 - val_loss: 0.0900 - val_accuracy: 0.9724
Epoch 6/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0785 - accuracy: 0.9758 - val_loss: 0.0703 - val_accuracy: 0.9757
Epoch 7/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0699 - accuracy: 0.9780 - val_loss: 0.1004 - val_accuracy: 0.9675
Epoch 8/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0648 - accuracy: 0.9798 - val_loss: 0.0716 - val_accuracy: 0.9785
Epoch 9/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0616 - accuracy: 0.9807 - val_loss: 0.0591 - val_accuracy: 0.9815
Epoch 10/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0575 - accuracy: 0.9823 - val_loss: 0.0776 - val_accuracy: 0.9761
Epoch 11/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0551 - accuracy: 0.9833 - val_loss: 0.0437 - val_accuracy: 0.9860
Epoch 12/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0532 - accuracy: 0.9838 - val_loss: 0.0598 - val_accuracy: 0.9825
Epoch 13/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0518 - accuracy: 0.9839 - val_loss: 0.0571 - val_accuracy: 0.9834
Epoch 14/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0489 - accuracy: 0.9848 - val_loss: 0.0487 - val_accuracy: 0.9857
Epoch 15/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0483 - accuracy: 0.9850 - val_loss: 0.0476 - val_accuracy: 0.9852
Epoch 16/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0448 - accuracy: 0.9861 - val_loss: 0.0730 - val_accuracy: 0.9779
Epoch 17/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0435 - accuracy: 0.9861 - val_loss: 0.3084 - val_accuracy: 0.9206
Epoch 18/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0427 - accuracy: 0.9869 - val_loss: 0.0572 - val_accuracy: 0.9834
Epoch 19/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0429 - accuracy: 0.9867 - val_loss: 0.0482 - val_accuracy: 0.9864
Epoch 20/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0429 - accuracy: 0.9864 - val_loss: 0.0404 - val_accuracy: 0.9882
Epoch 21/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0392 - accuracy: 0.9878 - val_loss: 0.0390 - val_accuracy: 0.9884
Epoch 22/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0397 - accuracy: 0.9876 - val_loss: 0.0348 - val_accuracy: 0.9896
Epoch 23/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0400 - accuracy: 0.9876 - val_loss: 0.0413 - val_accuracy: 0.9883
Epoch 24/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0392 - accuracy: 0.9879 - val_loss: 0.0498 - val_accuracy: 0.9852
Epoch 25/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0389 - accuracy: 0.9876 - val_loss: 0.0300 - val_accuracy: 0.9909
Epoch 26/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0366 - accuracy: 0.9883 - val_loss: 0.0471 - val_accuracy: 0.9865
Epoch 27/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0370 - accuracy: 0.9889 - val_loss: 0.0642 - val_accuracy: 0.9836
Epoch 28/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0384 - accuracy: 0.9882 - val_loss: 0.0362 - val_accuracy: 0.9885
Epoch 29/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0348 - accuracy: 0.9888 - val_loss: 0.0560 - val_accuracy: 0.9852
Epoch 30/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0377 - accuracy: 0.9883 - val_loss: 0.0376 - val_accuracy: 0.9893
Epoch 31/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0324 - accuracy: 0.9894 - val_loss: 0.0673 - val_accuracy: 0.9805
Epoch 32/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0349 - accuracy: 0.9887 - val_loss: 0.0393 - val_accuracy: 0.9901
Epoch 33/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0330 - accuracy: 0.9898 - val_loss: 0.0389 - val_accuracy: 0.9906
Epoch 34/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0309 - accuracy: 0.9907 - val_loss: 0.0373 - val_accuracy: 0.9888
Epoch 35/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0299 - accuracy: 0.9909 - val_loss: 0.0396 - val_accuracy: 0.9881
Epoch 36/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0325 - accuracy: 0.9897 - val_loss: 0.0316 - val_accuracy: 0.9909
Epoch 37/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0317 - accuracy: 0.9902 - val_loss: 0.0350 - val_accuracy: 0.9894
Epoch 38/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0304 - accuracy: 0.9907 - val_loss: 0.0326 - val_accuracy: 0.9912
Epoch 39/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0299 - accuracy: 0.9903 - val_loss: 0.0319 - val_accuracy: 0.9907
Epoch 40/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0311 - accuracy: 0.9905 - val_loss: 0.0380 - val_accuracy: 0.9897
Epoch 41/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0291 - accuracy: 0.9907 - val_loss: 0.0338 - val_accuracy: 0.9910
Epoch 42/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0294 - accuracy: 0.9907 - val_loss: 0.0612 - val_accuracy: 0.9837
Epoch 43/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0310 - accuracy: 0.9902 - val_loss: 0.0465 - val_accuracy: 0.9873
Epoch 44/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0286 - accuracy: 0.9909 - val_loss: 0.0371 - val_accuracy: 0.9897
Epoch 45/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0300 - accuracy: 0.9907 - val_loss: 0.0385 - val_accuracy: 0.9904
Epoch 46/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0266 - accuracy: 0.9915 - val_loss: 0.0359 - val_accuracy: 0.9911
Epoch 47/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0280 - accuracy: 0.9909 - val_loss: 0.0396 - val_accuracy: 0.9896
Epoch 48/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0268 - accuracy: 0.9915 - val_loss: 0.0587 - val_accuracy: 0.9851
Epoch 49/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0282 - accuracy: 0.9913 - val_loss: 0.0304 - val_accuracy: 0.9916
Epoch 50/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0280 - accuracy: 0.9912 - val_loss: 0.0682 - val_accuracy: 0.9827
Epoch 51/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0267 - accuracy: 0.9919 - val_loss: 0.0344 - val_accuracy: 0.9910
Epoch 52/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0260 - accuracy: 0.9920 - val_loss: 0.0294 - val_accuracy: 0.9924
Epoch 53/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0263 - accuracy: 0.9914 - val_loss: 0.0537 - val_accuracy: 0.9863
Epoch 54/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0263 - accuracy: 0.9917 - val_loss: 0.0304 - val_accuracy: 0.9917
Epoch 55/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0259 - accuracy: 0.9919 - val_loss: 0.0379 - val_accuracy: 0.9898
Epoch 56/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0240 - accuracy: 0.9923 - val_loss: 0.0406 - val_accuracy: 0.9894
Epoch 57/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0234 - accuracy: 0.9929 - val_loss: 0.0299 - val_accuracy: 0.9916
Epoch 58/100
2608/2608 [==============================] - 9s 4ms/step - loss: 0.0237 - accuracy: 0.9927 - val_loss: 0.0263 - val_accuracy: 0.9929
Epoch 59/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0246 - accuracy: 0.9927 - val_loss: 0.0557 - val_accuracy: 0.9847
Epoch 60/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0258 - accuracy: 0.9920 - val_loss: 0.0331 - val_accuracy: 0.9914
Epoch 61/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0241 - accuracy: 0.9924 - val_loss: 0.0337 - val_accuracy: 0.9913
Epoch 62/100
2608/2608 [==============================] - 9s 3ms/step - loss: 0.0232 - accuracy: 0.9924 - val_loss: 0.0307 - val_accuracy: 0.9919
Epoch 63/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0258 - accuracy: 0.9917 - val_loss: 0.0303 - val_accuracy: 0.9911
Epoch 64/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0226 - accuracy: 0.9926 - val_loss: 0.0279 - val_accuracy: 0.9919
Epoch 65/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0214 - accuracy: 0.9931 - val_loss: 0.0334 - val_accuracy: 0.9912
Epoch 66/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0242 - accuracy: 0.9926 - val_loss: 0.0341 - val_accuracy: 0.9918
Epoch 67/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0216 - accuracy: 0.9934 - val_loss: 0.0326 - val_accuracy: 0.9912
Epoch 68/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0224 - accuracy: 0.9930 - val_loss: 0.0275 - val_accuracy: 0.9930
Epoch 69/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0227 - accuracy: 0.9933 - val_loss: 0.0286 - val_accuracy: 0.9928
Epoch 70/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0231 - accuracy: 0.9926 - val_loss: 0.0336 - val_accuracy: 0.9907
Epoch 71/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0240 - accuracy: 0.9927 - val_loss: 0.0493 - val_accuracy: 0.9879
Epoch 72/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0219 - accuracy: 0.9931 - val_loss: 0.0386 - val_accuracy: 0.9900
Epoch 73/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0210 - accuracy: 0.9938 - val_loss: 0.0377 - val_accuracy: 0.9906
Epoch 74/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0215 - accuracy: 0.9932 - val_loss: 0.0440 - val_accuracy: 0.9902
Epoch 75/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0214 - accuracy: 0.9930 - val_loss: 0.0382 - val_accuracy: 0.9902
Epoch 76/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0197 - accuracy: 0.9935 - val_loss: 0.0837 - val_accuracy: 0.9751
Epoch 77/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0225 - accuracy: 0.9932 - val_loss: 0.0346 - val_accuracy: 0.9922
Epoch 78/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0213 - accuracy: 0.9934 - val_loss: 0.0296 - val_accuracy: 0.9923
Epoch 79/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0219 - accuracy: 0.9932 - val_loss: 0.0341 - val_accuracy: 0.9920
Epoch 80/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0215 - accuracy: 0.9934 - val_loss: 0.0363 - val_accuracy: 0.9905
Epoch 81/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0212 - accuracy: 0.9930 - val_loss: 0.0397 - val_accuracy: 0.9906
Epoch 82/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0210 - accuracy: 0.9933 - val_loss: 0.0292 - val_accuracy: 0.9930
Epoch 83/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0200 - accuracy: 0.9934 - val_loss: 0.0498 - val_accuracy: 0.9883
Epoch 84/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0196 - accuracy: 0.9940 - val_loss: 0.0469 - val_accuracy: 0.9878
Epoch 85/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0218 - accuracy: 0.9931 - val_loss: 0.0514 - val_accuracy: 0.9886
Epoch 86/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0206 - accuracy: 0.9934 - val_loss: 0.0432 - val_accuracy: 0.9897
Epoch 87/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0175 - accuracy: 0.9941 - val_loss: 0.0423 - val_accuracy: 0.9882
Epoch 88/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0232 - accuracy: 0.9930 - val_loss: 0.0487 - val_accuracy: 0.9879
Epoch 89/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0188 - accuracy: 0.9941 - val_loss: 0.0329 - val_accuracy: 0.9921
Epoch 90/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0178 - accuracy: 0.9943 - val_loss: 0.0389 - val_accuracy: 0.9894
Epoch 91/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0198 - accuracy: 0.9937 - val_loss: 0.0291 - val_accuracy: 0.9933
Epoch 92/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0177 - accuracy: 0.9945 - val_loss: 0.0470 - val_accuracy: 0.9889
Epoch 93/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0227 - accuracy: 0.9933 - val_loss: 0.0340 - val_accuracy: 0.9923
Epoch 94/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0198 - accuracy: 0.9939 - val_loss: 0.0283 - val_accuracy: 0.9940
Epoch 95/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0188 - accuracy: 0.9939 - val_loss: 0.0402 - val_accuracy: 0.9908
Epoch 96/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0185 - accuracy: 0.9941 - val_loss: 0.0603 - val_accuracy: 0.9820
Epoch 97/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0206 - accuracy: 0.9938 - val_loss: 0.0362 - val_accuracy: 0.9909
Epoch 98/100
2608/2608 [==============================] - 8s 3ms/step - loss: 0.0201 - accuracy: 0.9936 - val_loss: 0.0370 - val_accuracy: 0.9909
Epoch 99/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0173 - accuracy: 0.9945 - val_loss: 0.0529 - val_accuracy: 0.9885
Epoch 100/100
2608/2608 [==============================] - 7s 3ms/step - loss: 0.0188 - accuracy: 0.9939 - val_loss: 0.0473 - val_accuracy: 0.9892
In [70]:
10203040506070809010000.050.10.150.20.250.30.35
variableval_losstrain_lossTraining and Validation Lossxvalue
<Figure size 1200x600 with 0 Axes>
In [71]:
1020304050607080901000.860.880.90.920.940.960.981
variableval_acctrain_accTraining and Validation Accuracyxvalue
<Figure size 1200x600 with 0 Axes>
In [72]:
1118/1118 [==============================] - 2s 2ms/step - loss: 0.0473 - accuracy: 0.9892
Accuracy of model is 0.9891787767410278

Hotel%20booking%20prediction%2022.png

In [73]:
Out[73]:
Model Score
7 Cat Boost 0.995107
11 ANN 0.989179
6 XgBoost 0.982775
9 LGBM 0.967201
10 Voting Classifier 0.963118
3 Random Forest Classifier 0.953136
8 Extra Trees Classifier 0.950871
4 Ada Boost Classifier 0.946173
2 Decision Tree Classifier 0.945978
5 Gradient Boosting Classifier 0.906887
1 KNN 0.892850
0 Logistic Regression 0.810810
In [74]:
00.20.40.60.81Logistic RegressionKNNDecision Tree ClassifierRandom Forest ClassifierAda Boost ClassifierGradient Boosting ClassifierXgBoostCat BoostExtra Trees ClassifierLGBMVoting ClassifierANN
0.850.90.95ScoreModels ComparisonScoreModel

Hotel%20booking%20prediction%2023.png

In [ ]: